package com.sky.task;

import com.sky.service.OrderService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class OrderTask {
    @Autowired
    private OrderService orderService;
    @Scheduled(cron = "0 * * * * ?")
    public void processTimeoutOrder(){
        orderService.checkTimeAndStatus();
    }
    @Scheduled(cron = "0 35 13 * * ?")
    public void processTimeoutOrderComplete(){
        orderService.checkTimeAndStatusComplete();
    }
}
